//template 原始用法
const express = require('express');
const app = express();
app.listen(3000,()=>{
  console.log('服务器已启动');
});
let dataArr = {list: [
  {name:"后羿", content:"周日都让我射熄火了", date:"2018-10-10"},
  {name:"鲁班", content:"智商250...", date:"2018-10-10"},
  {name:"程咬金", content:"爱心之斧的正义冲击", date:"2018-10-10"},
  {name:"孙悟空", content:"俺老孙来也", date:"2018-10-10"},
  {name:"妲己", content:"妲己陪你玩哦", date:"2018-10-10"}
]};

const path = require('path');
const template = require('art-template');

app.get('/index',(req,res)=>{
  let str = template(path.join(__dirname,'./view/index.html'),dataArr);
  res.send(str);
});